package com.activemypc.app.extension

import android.content.*
import android.net.*
import com.activemypc.app.config.*

/**
 *
 * @Author mocaris
 * @Date 2025-07-22
 */

fun Context.toEmail(
    email: String,
    subject: String = "",
    body: String = ""
) {
    try {
        val uri = Uri.parse("mailto:${email}")
        val intent = Intent(Intent.ACTION_SENDTO, uri)
        intent.putExtra(Intent.EXTRA_SUBJECT, subject)
        intent.putExtra(Intent.EXTRA_EMAIL, arrayOf(body))
        this.startActivity(intent)
    } catch (e: Exception) {
        e.printStackTrace()
    }
}